package com.gh.service;

import com.gh.entity.CommonResult;
import com.gh.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Component
@FeignClient("cloud-payment-service")
public interface PaymentFeignService {

    @PostMapping("payment/create")
    CommonResult create(@RequestBody Payment payment);

    @GetMapping("payment/get/{id}")
    CommonResult getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/feign/timeout")
    String feignTimeout();

}
